﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PersonalMaster.Master" AutoEventWireup="true" CodeBehind="PersonalFriends.aspx.cs" Inherits="SonCa.SocialNetwork.Web.Personals.PersonalFriends" %>

<%@ Register Src="~/Personals/ASCX/ListFriends.ascx" TagName="ListFriends" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function MenuAction_PersonalFriend(id) {
            $("#dropdown_personalfriend_" + id).slideToggle();
        }

        function Unfriend(friendID) {
            if (confirm("Bạn có chắc muốn hủy kết bạn với người này ???")) {
                var currentID = $("#<%=hdfAccountID_Personalfriend.ClientID%>").val();
                $.ajax({
                    type: "post",
                    url: "../Services/AjaxService.svc/Unfriend",
                    data: '{"currentID": "' + currentID + '","friendID": "' + friendID + '"}',
                    contentType: "application/json; charset=urf-8;",
                    dataType: "json",
                    success: function () {
                        $("#personalFriend_" + friendID).hide();
                    }
                });
            }
        }
    </script>

    <div style="width:80%;margin:30px auto 0">
        <asp:Label ID="lblMessage_PersonalFriend" runat="server" Visible="false" ForeColor="Red"></asp:Label>
        <asp:HiddenField ID="hdfAccountID_Personalfriend" runat="server" />
        <asp:Repeater ID="rpt_PersonalFriends" runat="server" onitemdatabound="rpt_PersonalFriends_ItemDataBound">
            <ItemTemplate>
                <uc1:ListFriends ID="ListFriends1" runat="server" />
            </ItemTemplate>
        </asp:Repeater>
    </div>
</asp:Content>
